package act;

import java.util.concurrent.BlockingQueue;

public interface IActor
{   
   /**
    * Send this actor a message
    */
   public void send(Object msg);
   
   /**
    * Stop this actor
    */
   public void stop();

   /**
    * If you call this method it will block until the actor is stopped.
    * Usually an actor is stopped after it receives an End message in its queue
    */
   public void await();

   /*
	 * @param handler A handler to handle messages sent to the actor
	 * @param mailboxSize If 0 or less is specified the mailbox will be unbuffered
	*/
   public IActor create(IReceiver handler, int mailboxSize);
   
   /**
    * Create a new actor with a handler with an unbuffered mailbox;
    */
   public IActor create(IReceiver handler); 

   /**
    * Create a new actor with a handler with a specific implementation of BlockingQueue for its mailbocx
    */
   public IActor create(IReceiver handler, BlockingQueue<Object> mailbox); 
   
   

}

 